package com.chensi.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.chensi.common.AjaxJson;
import com.chensi.model.User;
import com.chensi.service.IUserService;

@Controller
@RequestMapping("api/user")
public class UserApi {
	
	@Autowired
	private IUserService userService;
	
	@RequestMapping("getByName")
	@ResponseBody
	public AjaxJson getByName(){
		User entity=new User();
		entity.setName("admin");
		return AjaxJson.getSuccessInfo(userService.getByEntity(entity));
	}
}
